package com.coding.controller;

import com.coding.base.pojo.BaseModel;
import com.coding.service.MileageService;
import com.wordnik.swagger.annotations.ApiOperation;
import com.wordnik.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @auther wangchenghao
 * @date 2020/8/11
 **/
@Controller
@ResponseBody
@RequestMapping("mileage")
public class MileageController {
    @Autowired
    MileageService mileageService;

    @ApiOperation("查询用户诗途里程")
    @RequestMapping(value = "/getUserMileage", method = {RequestMethod.GET})
    public BaseModel getUserMileage(@ApiParam("用户id") @RequestParam(value = "user_id", required = true) Integer user_id) throws Exception {
        BaseModel model = new BaseModel();
        mileageService.getUserMileage(user_id, model);
        return model;
    }
}
